<template>
  <div>
    child2：
    <span>{{childValue}}</span>
    <input type="button" value="click" @click="childClick">
  </div>
</template>
<script>
export default {
  name: "child2",
  data() {
    return {
      childValue: "子组件的值"
    };
  },
  methods: {
    childClick() {
      this.$emit("childByValue", this.childValue);
    }
  }
};
</script>